home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 2002 #11
/
Amiga Plus CD - 2002 - No. 11.iso
/
Tools
/
ShareMailGiftware
/
AmigaTalk
/
testfiles
/
TestGamePort
< prev
next >
Wrap
Text File
|
2002-10-27
|
1KB
|
53 lines
gp <- AbsJoyStick new
n <- 0
gp openGamePort: 1 named: 'AbsJoy1'
gp clearGamePortBuffer
gp setTimeTransition: 600 "60Hz * 10 seconds."
gp setKeyTransition: 3 "Up & down presses."
gp setXDeltaTransition: 1
gp setYDeltaTransition: 1
n <- gp getTriggerTime
('getTriggerTime = ', n) print "When will we time-out?"
n <- gp getTriggerKeys
('Trigger Keys = ', n) print
n <- gp getTriggerXDelta
('TriggerDeltaX = ', n) print
n <- gp getTriggerYDelta
('TriggerDeltaY = ', n) print
n <- gp getButtonCode
('Button Code = ', n) print
n <- gp getQualifiers
('Qualifiers = ', n) print
n <- gp getXPos
('X position = ', n) print
n <- gp getYPos
('Y position = ', n) print
'Press the fire button...' print
gp waitForButton: 16r68 "wait for the fire button."
gp waitForQualifier: 16r4000 "wait for the fire button."
"x & y position only assumes the values -1, 0 & +1 for Absolute Joysticks."
"For x, -1 = left, 0 = no movement, & +1 = right."
"For y, -1 = up, 0 = no movement, & +1 = down."
'Move the JoyStick around...' print
gp waitForXPos: 1
gp waitForYPos: 1
gp closeGamePort
'AbsJoy1 now closed!' print